﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 剪刀石头布
{
    class Program
    {
        static void Main(string[] args)
        {
            comper comper = new comper();
           
            
            string cc = "曹操";
            string lb = "刘备";
            string sq = "孙权";
            Console.WriteLine("*********猜拳开始***********");
            Console.WriteLine("出拳规则：1.剪刀2.石头3.布（输入相对应数字）");
            Console.WriteLine("请选择对象角色1.刘备2.孙权3.曹操");
            int num = int.Parse(Console.ReadLine());
            switch (num)
            { 
                case 1:
                    Console.WriteLine("请输入你的姓名");
                    string name = Console.ReadLine();
                    Console.WriteLine(name+"vs  刘备   对战");
                    Console.WriteLine("开始对战吗？（y/n）");
                    string kaishi = Console.ReadLine();
                    if (kaishi == "y")
                    {
                        while (true)
                        {
                            Console.WriteLine("请出拳：1.剪刀2.石头3.布（输入相对应数字）");
                            int a = int.Parse(Console.ReadLine());
                            switch (a)
                            {
                                case 1:
                                    Console.WriteLine(name + "：出拳：剪刀");
                                    Console.WriteLine("刘备：" + "出拳 ：" + comper.ShowFist());
                                    if (comper.ShowFist() == "剪刀")
                                    {
                                        Console.WriteLine("平局");
                                    }
                                    else if (comper.ShowFist() == "石头")
                                    {
                                        Console.WriteLine("刘备胜");
                                    }
                                    else if (comper.ShowFist() == "布")
                                    {
                                        Console.WriteLine(name + "胜");
                                    }
                                    break;
                                case 2:
                                    Console.WriteLine(name + "：出拳：石头");
                                    Console.WriteLine("刘备：" + "出拳 ：" + comper.ShowFist());
                                    if (comper.ShowFist() == "剪刀")
                                    {
                                        Console.WriteLine(name + "胜");
                                    }
                                    else if (comper.ShowFist() == "石头")
                                    {
                                        Console.WriteLine("平局");
                                    }
                                    else if (comper.ShowFist() == "布")
                                    {
                                        Console.WriteLine("刘备胜");
                                    }
                                    break;
                                case 3:
                                    Console.WriteLine(name + "：出拳：布");
                                    Console.WriteLine("刘备：" + "出拳 ：" + comper.ShowFist());
                                    if (comper.ShowFist() == "剪刀")
                                    {
                                        Console.WriteLine("刘备胜");
                                    }
                                    else if (comper.ShowFist() == "石头")
                                    {
                                        Console.WriteLine(name + "胜");
                                    }
                                    else if (comper.ShowFist() == "布")
                                    {
                                        Console.WriteLine("平局");
                                    }
                                    break;

                            }
                            Console.WriteLine("是否继续（）y/n");
                            string jixu = Console.ReadLine();
                            if (jixu=="n")
                            {
                                break;
                            }
                        }
                    }



                    else if (kaishi == "n")
                    {

                    }
                    else
                    {
                        Console.WriteLine("错了，不打就算了");
                    }
                    break;
                        
                    
                case 2:
                    Console.WriteLine("请输入你的姓名");
                    string name2 = Console.ReadLine();
                    Console.WriteLine(name2 + "vs  孙权   对战");
                    Console.WriteLine("开始对战吗？（y/n）");
                    string kaishi2 = Console.ReadLine();
                    if (kaishi2 == "y")
                    {
                        while (true)
                        {

                      
                        Console.WriteLine("请出拳：1.剪刀2.石头3.布（输入相对应数字）");
                        int a = int.Parse(Console.ReadLine());
                        switch (a)
                        {
                            case 1:
                                Console.WriteLine(name2 + "：出拳：剪刀");
                                Console.WriteLine("孙权：" + "出拳 ：" + comper.ShowFist());
                                if (comper.ShowFist() == "剪刀")
                                {
                                    Console.WriteLine("平局");
                                }
                                else if (comper.ShowFist() == "石头")
                                {
                                    Console.WriteLine("孙权");
                                }
                                else if (comper.ShowFist() == "布")
                                {
                                    Console.WriteLine(name2 + "胜");
                                }
                                break;
                            case 2:
                                Console.WriteLine(name2 + "：出拳：石头");
                                Console.WriteLine("孙权：" + "出拳 ：" + comper.ShowFist());
                                if (comper.ShowFist() == "剪刀")
                                {
                                    Console.WriteLine(name2 + "胜");
                                }
                                else if (comper.ShowFist() == "石头")
                                {
                                    Console.WriteLine("平局");
                                }
                                else if (comper.ShowFist() == "布")
                                {
                                    Console.WriteLine("孙权胜");
                                }
                                break;
                            case 3:
                                Console.WriteLine(name2 + "：出拳：布");
                                Console.WriteLine("孙权：" + "出拳 ：" + comper.ShowFist());
                                if (comper.ShowFist() == "剪刀")
                                {
                                    Console.WriteLine("孙权胜");
                                }
                                else if (comper.ShowFist() == "石头")
                                {
                                    Console.WriteLine(name2 + "胜");
                                }
                                else if (comper.ShowFist() == "布")
                                {
                                    Console.WriteLine("平局");
                                }
                                break;
                                
                        }
                            Console.WriteLine("是否继续（）y/n");
                            string jixu = Console.ReadLine();
                            if (jixu == "n")
                            {
                                break;
                            }
                        }
                    }
                    else if (kaishi2 == "n")
                    {

                    }
                    else
                    {
                        Console.WriteLine("错了，不打就算了");
                    }
                    break;

                    break;
                case 3:
                    Console.WriteLine("请输入你的姓名");
                    string name3 = Console.ReadLine();
                    Console.WriteLine(name3 + "vs  曹操   对战");
                    Console.WriteLine("开始对战吗？（y/n）");
                    string kaishi3 = Console.ReadLine();
                    if (kaishi3 == "y")
                    {
                        while (true)
                        {

                        
                        Console.WriteLine("请出拳：1.剪刀2.石头3.布（输入相对应数字）");
                        int a = int.Parse(Console.ReadLine());
                            switch (a)
                            {
                                case 1:
                                    Console.WriteLine(name3 + "：出拳：剪刀");
                                    Console.WriteLine("曹操：" + "出拳 ：" + comper.ShowFist());
                                    if (comper.ShowFist() == "剪刀")
                                    {
                                        Console.WriteLine("平局");
                                    }
                                    else if (comper.ShowFist() == "石头")
                                    {
                                        Console.WriteLine("曹操胜");
                                    }
                                    else if (comper.ShowFist() == "布")
                                    {
                                        Console.WriteLine(name3 + "胜");
                                    }
                                    break;
                                case 2:
                                    Console.WriteLine(name3 + "：出拳：石头");
                                    Console.WriteLine("曹操：" + "出拳 ：" + comper.ShowFist());
                                    if (comper.ShowFist() == "剪刀")
                                    {
                                        Console.WriteLine(name3 + "胜");
                                    }
                                    else if (comper.ShowFist() == "石头")
                                    {
                                        Console.WriteLine("平局");
                                    }
                                    else if (comper.ShowFist() == "布")
                                    {
                                        Console.WriteLine("曹操胜");
                                    }
                                    break;
                                case 3:
                                    Console.WriteLine(name3 + "：出拳：布");
                                    Console.WriteLine("曹操：" + "出拳 ：" + comper.ShowFist());
                                    if (comper.ShowFist() == "剪刀")
                                    {
                                        Console.WriteLine("曹操胜");
                                    }
                                    else if (comper.ShowFist() == "石头")
                                    {
                                        Console.WriteLine(name3 + "胜");
                                    }
                                    else if (comper.ShowFist() == "布")
                                    {
                                        Console.WriteLine("平局");
                                    }
                                    break;
                            }
                            Console.WriteLine("是否继续（）y/n");
                            string jixu = Console.ReadLine();
                            if (jixu == "n")
                            {
                                break;
                            }
                        }


                    }
                    else if (kaishi3 == "n")
                    {

                    }
                    else
                    {
                        Console.WriteLine("错了，不打就算了");
                    }
                    break;

                default:
                    break;
            }
        }
    }
}
